{# What Datasets, Runs and Compare share: a case as it went in a run (``overseer_ai_evals._result``), opened under its row. #} {% from "components/macros/icons.html" import icon %} {% from "components/macros/layout.html" import code_block, goto %} {# A check by its rule; a run kept before rules were says so. #} {% macro rule(text) %}{% if text %}{{ text }}{% else %}rule not recorded{% endif %}{% endmacro %} {# Each check by its rule, a pass or fail mark and why. #} {% macro checks(found) %} {% endmacro %} {# ``r``: what it asked (where ``asked``), the answer whole, each check, and its calls summed up, each one's arguments (not its output, which can run long) behind the toggle; ``run_link`` names the run it is from. #} {% macro case_result(r, asked=True, run_link=False) %}
{% if asked and r.asked %}

Asked {{ r.asked }}

{% endif %}

Answer · {{ r.took }}{% if r.cost %} · {{ r.cost }}{% endif %}{% if run_link %} · {{ goto(r.run.url, "run " ~ r.run.id) }}{% endif %}

{% if r.error %}

{{ r.error }}

{% endif %} {% if r.answer %}

{{ r.answer }}

{% endif %} {{ checks(r.checks) }} {% if r.calls %}
{{ r.called }} · arguments
{% for run in r.calls %}

{{ loop.index }}. {{ run.tool }}{% if run.failed %} failed{% endif %}

{% if run.code %}{{ code_block(run.code, "Script", "python") }}{% elif run.args %}{{ code_block(run.args, "Arguments", "json") }}{% else %}

No arguments.

{% endif %}
{% endfor %}
{% else %}

{{ r.called }}

{% endif %}
{% endmacro %}